<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- 引入样式 -->
<!--    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">-->
    <link rel="stylesheet"  href="../css/index.css">
    <script src="../js/axios.min.js" type="text/javascript"></script>
    <script src="../js/vue.js" type="text/javascript"></script>
    <script src="../js/index.js" type="text/javascript"></script>
<!--    <script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
    <title>场馆登录界面</title>

</head>
<body>
<div id="app">
    <el-row style="margin-top: 150px;">
        <el-col :span="8" :offset="8">
            <el-form ref="form" :model="venueLoginForm" label-width="80px">
                <el-form-item label="场馆账号">
                    <el-input v-model="venueLoginForm.accountName" placeholder="请输入场馆账号名"></el-input>
                </el-form-item>
                <el-form-item label="场馆密码">
                    <el-input v-model="venueLoginForm.password" show-password placeholder="请输入场馆密码"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="onSubmit">立即登录</el-button>
                    <el-button @click="forget">忘记密码</el-button>
                    <el-button @click="toRegister">去注册</el-button>
                </el-form-item>
            </el-form>
        </el-col>
    </el-row>
</div>
<script>
    new Vue({
        el: "#app",
        data() {
            return {
                venueLoginForm: {
                    accountName: '',
                    password: ''
                }
            }
        },
        methods: {
            toRegister() {
                window.location.href = 'venueRegister.html '

                // setTimeout(() => {
                //     window.location.href = 'accountCenter.html'
                // }, 800)

            },
            onSubmit() {
                axios.post("/venue/venueLogin", this.venueLoginForm).then(resp => {
                    console.log(this.venueLoginForm);
                    if (resp.status === 200) {
                        this.$message({
                            type: 'success',
                            message: '登录成功，即将跳转'
                        });
                        setTimeout(() => {
                            window.location.href = 'venueHome.html'
                        }, 800)
                    }
                })
            },
            forget() {
                location.href = 'venueFindPass.html'// 忘记密码
            }
        }
    })
</script>
</body>
</html>
